-- @owner: songjing20
-- @date: 2024-7-12
-- @testpoint: cte alias + connect by 语句测试,合理报错

--step1:创建表并插入数据;expect:成功
drop table if exists t_connectby_0027;
create table t_connectby_0027 (col numeric(3));
insert into t_connectby_0027 values ('1'),('2'),('3'),('4'),('');

--step2:执行cte+connect by语句;expect:合理报错
with alias5 as (
select
alias1.col as alias2
from
t_connectby_0027 as alias1
connect by
nocycle alias1.col >= alias1.col ),

alias8 as (
select
*
from
alias5
connect by
nocycle prior alias5.alias2 != alias5.alias2)

select
*
from
alias8,
t_connectby_0027
connect by
nocycle prior t_connectby_0027.col < t_connectby_0027.col;

--step3:删除表;expect:删除成功
drop table t_connectby_0027;
